import { empPageSelecct } from '@/api/organize'
import { ref } from 'vue'

const useCustomerServiceOptions = () => {
  const getCustomerServiceOptionsLoading = ref(false)
  const customerServiceOptions = ref([])

  const getCustomerServiceOptions = async (keyword: string) => {
    getCustomerServiceOptionsLoading.value = true
    const res = await empPageSelecct({
      limit: 0,
      name: keyword,
      page: 0,
    })
    if (res.data.success) {
      customerServiceOptions.value = res.data.data.rows
    }
    getCustomerServiceOptionsLoading.value = false
  }

  return {
    customerServiceOptions,
    getCustomerServiceOptionsLoading,
    getCustomerServiceOptions,
  }
}

export default useCustomerServiceOptions
